package com.tingyuge.thinking.spring.dependency.lookup;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author xiaodao
 * @version 1.0
 * @date 2021/6/27
 */
public class BeanInstantiationExceptionDemo {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        //注册 beanDefinition
        BeanDefinitionBuilder beanDefinitionBuilder =BeanDefinitionBuilder.genericBeanDefinition(CharSequence.class);

        applicationContext.registerBeanDefinition("beanDefinitionBuilder",beanDefinitionBuilder.getBeanDefinition());
        //启动应用上下文
        applicationContext.refresh();
    }
}
